/*
* autoupdate.h - This file is the part of the wp-notifier.(code name "luan luan")
* Copyright (C) 2010 Dean Lee <deanlee3@gmail.com>, http://www.deanlee.cn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
* 
* Acknowledgements:
*   <> Many thanks to all of you, who have encouraged me to update my articles
*     and code, and who sent in bug reports and fixes.
* 
*/
#ifndef AUTOUPDATE_H
#define AUTOUPDATE_H
#include <QObject>
#include <QDialog>
class QNetworkAccessManager;
class QNetworkReply;

#define DOWNLOAD_URL "http://code.google.com/p/wp-comments-notifier/downloads/list"
#define CHECK_VERSION_URL "http://www.deanlee.cn/wp-comments-notifier/version.php"

class NewVersionDlg : public QDialog
{
	Q_OBJECT
public:
	NewVersionDlg(const QString& msg, QWidget* parent = NULL);
	~NewVersionDlg();
};

class AutoUpdate : public QObject
{
	Q_OBJECT
public:
	AutoUpdate(QObject* parent = NULL);
	~AutoUpdate();
signals:
	void updateAvailable(const QString& newVersion);
protected slots:
	void replyFinished(QNetworkReply*);
protected:
	QNetworkAccessManager* m_manager;
};
#endif